import { Application } from 'egg';

export default (app: Application) => {
    const { STRING, CHAR, INTEGER, DATE } = app.Sequelize;
    const model = app.model.define('Project', {
        project_id: {
            type: CHAR(32),
            primaryKey: true
        },//主键id
        project_name: STRING(50),//项目名
        project_rule: STRING(100),//考核规则
        project_min: INTEGER(2),//打分最小单位
        project_max: INTEGER(2),//给同一个人最多可以打多少分
        project_is_self: CHAR(1),//是否可以给自己打分（1：是，2：否）
        project_start_time: DATE(0),//开始时间
        project_end_time: DATE(0),//结束时间
        project_status: CHAR(1),//状态（1：未开始，2：进行中，3：暂停，4：结束）
        created_by: CHAR(32),//创建人
        updated_by: CHAR(32),//更新人
        is_delete: CHAR(1),//标识是否删除（0：否，1：是）
    }, { tableName: 't_project' });
    return model;
};
export class Project {
    project_id: string;
    project_name: string;
    project_rule: string;
    project_min: number;
    project_max: number;
    project_is_self: string;
    project_start_time: string;
    project_end_time: string;
    project_status: string;
    created_by: string;
    updated_by: string;
    is_delete: string;
}